<template>
    <div style="height: 350px">
        <iframe :src="rabbit" id="mobsf" scrolling="no" frameborder="0" style="width:auto; height: 370px"></iframe>
    </div>
</template>
<script>
    // import { getUuid, getShopName } from "@/utils/auth";//登录获取的uuid
    export default {
        data () {
            return {
                rabbit:'',
            }
        },
        created(){//跳转外部链接
             this.rabbit='https://jbhotel.cklock.cn/vuerabbit?uuid='+sessionStorage.getItem("uuid");
            //this.rabbit='http://localhost:8080?uuid='+sessionStorage.getItem("uuid");
        },
        mounted(){
            /**
             * iframe-宽高自适应显示
             */
            function changeMobsfIframe(){
                const mobsf = document.getElementById('mobsf');
                const deviceWidth = document.body.clientWidth;
                const deviceHeight = document.body.clientHeight;
// mobsf.style.width = (Number(deviceWidth)-210) + 'px'; //数字是页面布局宽度差值
                mobsf.style.width = '100%' ; //宽度百分比自适应
                mobsf.style.height = (Number(deviceHeight)-64) + 'px'; //数字是页面布局高度差
            }
            changeMobsfIframe()
            window.onresize = function(){
                changeMobsfIframe()
            }
        }
    }
</script>
